import request from '@/router/axios';

export const executeReconciliation = (data) => {
  return request({
    url: '/api/mes-warehouse/erpinventorycheck/manual-check',
    method: 'post',
    data
  });
};

export const getReconciliation = (id) => {
  return request({
    url: '/api/mes-warehouse/erpinventorycheck/detail',
    method: 'get',
    params: {
      id
    }
  });
};

export const getReconciliationList = (params) => {
  return request({
    url: '/api/mes-warehouse/erpinventorycheckdetail/page?checkResult=DISCREPANCY',
    method: 'get',
    params
  });
};
// 对账记录明细
export const getReconciliationRecordList = (params) => {
  return request({
    url: '/api/mes-warehouse/erpinventorycheck/page',
    method: 'get',
    params
  });
};

// 删除对账记录
export const removeReconciliationRecord = (params) => {
  return request({
    url: '/api/mes-warehouse/erpinventorycheck/remove',
    method: 'post',
    params
  });
};

export const saveReconciliationRule = (data) => {
  return request({
    url: '/api/mes-warehouse/erpInventoryRule/submit',
    method: 'post',
    data
  });
};
// 获取当前设置的对账规则
export const getReconciliationRule = () => {
  return request({
    url: '/api/mes-warehouse/erpInventoryRule/last/detail',
    method: 'get'
  });
};
